{include file="./../application/web/view/laytpl/header.html"/}
<style>
    html, body {
	height: 100%;
	overflow: hidden
    }
    .box{
        height: 100%
    }
    .nav {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	text-align: center;
    }
    
    .lefts {
            position: absolute;
            width: 280px;
            top: 89px;
            left: 0;
    }
    .right{
	float: right;
	top: 90px;
	right: 0;
    }
    
    .VerticalMenu{
        overflow-y: auto;
    }
    
    .kinds{
        position: absolute;
        top: 54px;
    }
    
</style>
                        <div class="kinds">
                            {volist name='pdata' id='dt'}
                                <a href="manual?id={$dt.id}" {eq name='dt.id' value='$id'}class='addkind'{/eq} data-id='{$dt.id}'>{$dt.title}</a>
                            {/volist}
			</div>
			<div class="sec-box manual-box">
			<div class="lefts fl">
				<ul class="tab fl">
					<li>
						<a href="#">目录</a>
					</li>
					<li>
						<a href="#">搜索</a>
					</li>
				</ul>
				<!--目录-->
				<div class="itme Catalog">
					<div class="VerticalMenu">
                                            {volist name='data' id='dt'}
                                                <div class="manual">
							<div><span>{$dt.title}</span><i class="fa fa-angle-right fa-lg"></i></div>
							<div class="aside-item" name="xz">
                                                            {volist name='dt.manual' id='mdt'}
								<div class="adide"><!--addasid-->
									<div><span class="jumpcud" data-url='{:url("index/right")}?id={$mdt.id}' onclick='dianji(this)'>{$mdt.title}</span></div>
								</div>
                                                            {/volist}
							</div>
						</div>
                                            {/volist}
					</div>
				</div>
				<!--评论-->
				<div class="itme comment">
					<div class="inp">
						<input id="sertext" type="text" placeholder="请输入搜索关键字" />
					    <a href="javascript:;" id="searchBut"><img src="/static/images/web/ser.png" /></a>
					</div>
                                    <div class="VerticalMenu">
                                        <div class="manual">
                                                    <div id="searchList" class="aside-item" name="xz" style="  padding-right: 0px;  padding-left: 0px; display: block">
<!--                                                                <div class="adide">addasid
									<div><span data-url='' onclick=''>请输入搜索的关键字！</span></div>
								</div>-->
                                                    </div>
                                        </div>
                                    </div>
				</div>
                                
				<!--收藏-->
				<div class="itme Collection">
					<p>暂无收藏</p>
				</div>
			</div>
			<!--右侧iframe-->
			<div class="right fr">
				<iframe id="ifr" frameborder="0" width="100%" scrolling="yes" src=""></iframe>
			</div></div>
		</div>
	</body>
        <script>
           var fs1 = $('.VerticalMenu').children(".manual").get(0);
           if(fs1){
               $(fs1).children(".aside-item").show();
                var fs2 = $(fs1).children(".aside-item").children(".adide").get(0);
                $(fs2).addClass('addasid');
            }
            if(fs2){
                var fsurl = $(fs2).find('.jumpcud').attr('data-url');
            }
            
            if(fsurl){
                $('#ifr').attr('src',fsurl);
            }
           
            function layout(){
                $(".VerticalMenu").css("height",$(window).height() - 128); 
                $(".sec-box").css("height",$(window).height()+2);
                $(".right").css("height",$(window).height()+2); 
                $(".right").css("width",$(window).width()-280); 
                $("#ifr").css("height",$(window).height()-100); 
            }
            
            layout();
            $(window).resize(function(){layout()}); 
            
            $('#searchBut').click(function(){
                var text = $('#sertext').val();
                var pid = $('.addkind').attr('data-id');
                $.ajax({ 
                        url: '{:url("Index/searchManual")}',
                        data:  {keyword:text,pid:pid},
                        dataType:"json",
                        type: "POST",
                        success:function( res ){
                            var htmls = '';
                            $.each(res,function(index,contents){
                                var url = '{:url("index/right")}?id='+contents.id;
                                htmls+='<div class="adide">'+
                                            '<div><span data-url="'+url+'" onclick="dianji(this)">'+contents.title+'</span></div>'+
                                       '</div>';
                            })
                            if(htmls == ''){
                                htmls+='<div class="adide"><div><span data-url="" onclick="">没有找到数据！！！</span></div></div>';
                            }
                            $('#searchList').html(htmls);
                        },
                        fail:function(){
                            return;
                        }
                });
            })
        </script>

</html>